package com.his.his_system.controller.DruginventoryController;

import com.his.his_system.mapper.DzmHisMemberMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Component;

import java.util.LinkedHashMap;

@Component
public class LoginInfo {
    @Autowired
    private DzmHisMemberMapper dzmHisMemberMapper;


    public   Integer  getHospitalId(){
//
//        DzmHisMember byId = dzmHisMemberMapper.selectOneByUid(getUserId());
//        return byId.getPId();
        return 1;
  }

    public   Integer  getUserId(){
        LinkedHashMap auth = (LinkedHashMap) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        return (Integer) auth.get("uid");
    }



}
